package com.neusoft.EYSystem.redisDao.impl;

import com.neusoft.EYSystem.redisDao.RedisDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Repository;

import java.util.concurrent.TimeUnit;

@Repository
public class RedisDAOImpl implements RedisDAO {
    // 这里可以实现RedisDAO接口的方法
    // 例如，使用Spring Data Redis或Jedis等库来实现具体的Redis操作
    @Autowired
    private RedisTemplate redisTemplate;

    // 示例方法
     @Override
     public void set(String key, String value, long expireTime, TimeUnit timeUnit) {
         ValueOperations vo = redisTemplate.opsForValue();
         vo.set(key, value, expireTime, timeUnit);
     }

     @Override
     public String get(String key) {
         // 实现从Redis获取值的逻辑
         ValueOperations vo = redisTemplate.opsForValue();
         return (String) vo.get(key);
     }
}
